<?php
class Pageley_Domain_Attribute_UniqueDecorator extends Pageley_Domain_Attribute_Decorator {
    
    public function __construct($attribute, $gateway) {
        $validators = new Pageley_Util_ArrayMap();
        $unique = new Pageley_Domain_Validator_Unique();
        $unique->setGateway($gateway);
        $validators->add($unique);
        parent::__construct($attribute, $validators);
    }
    
    public function __toString() {
        return $this->getName() . "(unique)";
    }
}